{extend name='main'}

{block name="button"}
{if auth("add")}
<button data-modal='{:url("add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
{/if}

{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='shop_admin/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-center nowrap'>编号</th>
            <th class='text-left nowrap'>姓名</th>
            <th class='text-left nowrap'>所属组织</th>
            <th class='text-left nowrap'>关联店铺</th>
            <th class='text-left nowrap'>手机号码</th>
            <th class='text-left nowrap'>创建时间</th>
            <th class='text-center nowrap'>扫码授权</th>
            <th class='text-center nowrap'>操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key => $vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-center'>{$vo.id|default=''}</td>
            <td class='text-left'>{$vo.name|default=''}</td>
            <td class='text-left'>{$vo.department_name|default=''}</td>
            <td class='text-left'>
                {notempty name='vo.shop_name'}
                <p class="text-left layui-elip" style='max-width:600px' data-tips-text="{$vo.shop_name|default='-'}">{$vo.shop_name|default='-'}</p>
                {else}
                -
                {/notempty}
            </td>
            <td class='text-left'>{$vo.phone|default='-'}</td>
            <td class='text-left'>
                {if isset($vo.create_time) and $vo.create_time eq 0}
                {else}
                {$vo.create_time|date='Y-m-d H:i:s'|default=''}
                {/if}
            </td>
            <td style="display: none;">{$vo.openid|default=''}</td>
            <td class='text-center'>
                {if $vo.openid eq ''}
                <img data-tips-image="" height="80px" src="{$vo.qrcode|default=''}" alt="">
                {else}
                <div style="height: 80px;line-height: 80px;">已授权</div>
                {/if}
            </td>
            <td class="text-center">
                {if auth('edit')}
                <a data-dbclick class="layui-btn layui-btn-xs" data-title="编辑菜单" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}
                {if auth('remove')}
                <a class="layui-btn layui-btn-danger layui-btn-xs" data-confirm="确定要删除吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                {/if}
                {if auth('clearAuth')}
                <a class="layui-btn layui-btn-normal layui-btn-xs" data-confirm="确定要清除授权吗?" data-action="{:url('clearAuth')}" data-value="id#{$vo.id}">清除授权</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}